package com.lmf.annotation.bean;

import org.springframework.context.ApplicationEvent;

//自定义监听器事件：必须继承ApplicationEvent，然后通过容器发布事件，才会被拦截监听
public class MyApplicationEvent extends ApplicationEvent {
    /**
     * Create a new ApplicationEvent.
     *
     * @param source the object on which the event initially occurred (never {@code null})
     */
    public MyApplicationEvent(Object source) {
        super(source);
        System.out.println("利用ApplicationEvent子类发布事件");
    }
}
